<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="file" class="upload">
    <img id="img" />
    <script src="../axios/axios.min.js"></script>
    <script>
        document.querySelector('.upload').addEventListener('change',function(){
            const data = new FormData()
            data.append('file',this.files[0])
            axios({
                url:'http://1fd165e2.r23.cpolar.top/upload',
                method:'POST',
                Headers:{
                    'content-type':'multipart/form-data'
                },
                data 
            }).then(res=>{
                console.log(res);
                document.querySelector('#img').src = res.data.data
            })
        })
    </script>
</body>
</html>